Communication Apparatus

ABSTRACT

A communication apparatus may obtain a first wireless connection request from a first external apparatus, determine whether a connection number has reached an upper limit, supply first wait information to the first external apparatus in a case where it is determined that the connection number has reached the upper limit, and newly form a second wireless network which is different from a first wireless network to which both of the communication apparatus and a specific external apparatus had belonged, so as to establish a wireless connection with the first external apparatus, in a case where a wireless connection between the communication apparatus and the specific external apparatus is disconnected after the first wait information is supplied to the first external apparatus. In the first and second wireless networks, the communication apparatus may be configured to operate as a parent station.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to Japanese Patent Application No.2013-203099, filed on Sep. 30, 2013, the contents of which are herebyincorporated by reference into the present application.

TECHNICAL FIELD

This specification discloses a communication apparatus which can operateas a parent station of a wireless network.

DESCRIPTION OF RELATED ART

In the Wi-Fi Direct method formulated by the Wi-Fi Alliance, anapparatus in a Group Owner state (hereinafter referred to as a “G/Oapparatus”) forms a wireless network. In the G/O apparatus, an upperlimit of a number of a wireless connection (hereinafter referred to as a“connection number”) which can be simultaneously established by the G/Oapparatus itself is usually determined in advance. Therefore, if the G/Oapparatus obtains a wireless connection request from another apparatusin a state where the connection number has reached the upper limit, itis difficult to newly establish a wireless connection with the anotherapparatus and thus, it is usually difficult to perform a wirelesscommunication with the another apparatus.

SUMMARY

In the present specification, a technique is provided that acommunication apparatus appropriately performs a wireless communicationwith an external apparatus in a case where the communication apparatusobtains a wireless connection request from the external apparatus in astate where a number of a wireless connection being currentlyestablished by the communication apparatus operating as a parent stationof a wireless network has reached an upper limit.

A communication apparatus may comprise: a processor; and a memorystoring computer-readable instructions therein. The computer-readableinstructions, when executed by the processor, may cause thecommunication apparatus to: obtain a first wireless connection requestfrom a first external apparatus; determine whether a connection numberhas reached an upper limit in a case where the first wireless connectionrequest is obtained from the first external apparatus, the connectionnumber being a total number of a wireless connection which has beencurrently established by the communication apparatus; supply first waitinformation to the first external apparatus in a case where the firstwireless connection request is obtained from the first externalapparatus and it is determined that the connection number has reachedthe upper limit, the first wait information being for causing the firstexternal apparatus to wait until when a situation is realized where thecommunication apparatus is capable of establishing a wireless connectionwith the first external apparatus; and newly form a second wirelessnetwork which is different from a first wireless network to which bothof the communication apparatus and a specific external apparatus hadbelonged, so as to establish a wireless connection with the firstexternal apparatus, in a case where a wireless connection between thecommunication apparatus and the specific external apparatus isdisconnected after the first wait information is supplied to the firstexternal apparatus, wherein in the first wireless network, thecommunication apparatus is configured to operate as a parent station andthe specific external apparatus is configured to operate as a childstation, and in the second wireless network, the communication apparatusis configured to operate as a parent station and the first externalapparatus is configured to operate as a child station.

A control method, computer-readable instructions, and a non-transitorycomputer-readable medium storing the computer-readable instructions forrealizing the above communication apparatus are also new and useful. Amethod performed by the above communication apparatus is also new anduseful. Moreover, a system comprising the above communication apparatusand any of the above external apparatuses (for example, a specificexternal apparatus, a first external apparatus, and a second externalapparatus) is also new and useful.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a configuration of a communication system.

FIG. 2 illustrates a flowchart of a main process of a printer.

FIG. 3 illustrates a flowchart of a first communication process of theprinter.

FIG. 4 illustrates a flowchart of a second communication process of theprinter.

FIG. 5 illustrates a flowchart of an application process of a terminal.

FIG. 6 illustrates a flowchart of a wait process of the terminal.

FIG. 7 illustrates a sequence chart of a case A in which the printerforms two WFDNWs.

FIG. 8 illustrates a sequence chart of a case B in which the printercauses two terminals to wait.

FIG. 9 illustrates a sequence chart of a case C in which the printercauses the two terminals to wait.

EMBODIMENT

(Configuration of System; FIG. 1)

As illustrated in FIG. 1, a communication system 2 of this embodimentincludes a printer PR and a plurality of terminals Ta to Td, Each of theprinter PR and the terminals Ta to Td is capable of performing each ofan NFC communication which is a wireless communication according to anNFC (abbreviation of Near Field Communication) method and a Wi-Ficommunication which is a wireless communication according to a Wi-Fimethod formulated by the Wi-Fi Alliance.

(Configuration of Printer PR)

The printer PR is a peripheral apparatus (that is, a peripheralequipment of a PC (abbreviation of Personal Computer) and the like)capable of executing a printing function. The printer PR includes anoperation unit 12, a display unit 14, a print performing unit 16, an NFCinterface 18, a wireless LAN (abbreviation of Local Area Network)interface 20, and a controller 30. Each of the units 12 to 30 isconnected to a bus line (reference numeral omitted). In the following,the interface will be described as “I/F”.

The operating unit 12 comprises a plurality of keys. A user can inputvarious instructions to the printer PR by operating the operating unit12. The display unit 14 is a display for displaying various kinds ofinformation. The print performing unit 16 is a printing mechanism suchas an inkjet-type, a laser type and the like.

The NFC I/F 18 is an I/F for performing the NFC communication accordingto the NFC method. The NFC method is a wireless communication method forperforming a wireless communication in conformity to, for example, theinternational standards of ISO/IEC21481 or 18092.

The wireless LAN I/F 20 is an interface for performing the Wi-Ficommunication according to the Wi-Fi method. The Wi-Fi method is, forexample, a wireless communication method for performing a wirelesscommunication in conformity to the standard of IEEE (abbreviation of theInstitute of Electrical and Electronics Engineers, Inc.) 802.11 and thestandards (802.11a, 11b, 11g, 11n and the like, for example)corresponding to IEEE 802.11. More specifically, the wireless LAN I/F 20is an I/F supporting the WFD (abbreviation of Wi-Fi Direct) methodformulated by the Wi-Fi Alliance. Therefore, the controller 30 canperform the Wi-Fi communication via the wireless LAN I/F 20 by using awireless network of the WFD method (hereinafter referred to as “WFDNW”).

The wireless LAN I/F 20 is physically a single interface (that is, asingle IC chip). However, two MAC addresses (hereinafter referred to as“MACx” and “MACy”) are allocated in advance to the wireless LAN I/F 20.Therefore, the controller 30 is capable of simultaneously performingboth the Wi-Fi communication using MACx and the Wi-Fi communicationusing MACy.

The NFC I/F 18 and the wireless LAN I/F 20 are different from each otherin the following points. A communication speed of the wirelesscommunication via the wireless LAN I/F 20 (the maximum communicationspeed is 11 to 600 Mbps, for example) is faster than the communicationspeed of the wireless communication via the NFC I/F 18 (the maximumcommunication speed is 100 to 424 Kbps, for example). Moreover, afrequency of a carrier wave in the wireless communication via thewireless LAN I/F 20 (2.4 GHz band, 5.0 GHz band, for example) isdifferent from the frequency of the carrier wave in the wirelesscommunication via the NFC I/F 18 (13.56 MHz band, for example).Moreover, a maximum distance for which the printer PR can perform thewireless communication with an external apparatus via the wireless LANI/F 20 (100 m at the maximum, for example) is larger than the maximumdistance for which the printer PR can perform the wireless communicationwith the external apparatus via the NFC I/F 18 (10 cm at the maximum,for example).

The controller 30 comprises a CPU 32 and a memory 34. The CPU 32 is aprocessor for executing various processes in accordance with a program36 stored in the memory 34. The memory 34 comprises a first NW storagearea SAx, a second NW storage area SAy, and a wait list WL.

The first NW storage area SAx stores information relating to a WFDNW inwhich MACx is used as a MAC address of the printer PR. Hereinafter, thisWFDNW is referred to as “WFDNW corresponding to MACx”. The second NWstorage area SAy stores information relating to a WFDNW in which MACy isused as a MAC address of the printer PR. Hereinafter, this WFDNW isreferred to as “WFDNW corresponding to MACy”. The printer PR operates asa parent station (that is, a Group Owner of the WFD method) both in theWFDNW corresponding to MACx and the WFDNW corresponding to MACy. Theprinter PR can construct a state where the two WFDNW in which theprinter PR itself operates as the parent station are present at the sametime.

The first NW storage area SAx stores a wireless profile Px and amanaging list Lx when the WFDNW corresponding to MACx is present. Thewireless profile Px and the managing list Lx are registered in the firstNW storage area SAx when a wireless connection with any of the terminalsis established and is deleted from the first NW storage area SAx whenthe wireless connection is disconnected. The wireless profile Px iswireless setting information used in the WFDNW corresponding to MACx andincludes an SSID (abbreviation of Service Set IDentifier), anauthentication method, an encryption method, and a password. The SSID isan identifier for identifying the WFDNW corresponding to MACx. Theauthentication method, the encryption method, and the password areinformation used in authentication and encryption executed in the WFDNWcorresponding to MACx.

In the managing list Lx, the MAC address of an apparatus operating as achild station of the WFDNW corresponding to MACx is described. That is,in the managing list Lx, the MAC address of the apparatus with which awireless connection is established with the printer PR operating as aparent station of the WFDNW corresponding to MACx is described. In thisembodiment, the maximum number of a wireless connection (hereinafterreferred to as the “maximum number corresponding to MACx”) that can beestablished by the printer PR operating as the parent station of theWFDNW corresponding to MACx is “1”. Therefore, in the managing list Lx,one MAC address at the maximum is described.

The second NW storage area SAy stores a wireless profile Py and amanaging list Ly when the WFDNW corresponding to MACy is present. Thewireless profile Py and the managing list Ly are registered in thesecond NW storage area SAy when a wireless connection with any of theterminals is established and is deleted from the second NW storage areaSAy when the wireless connection is disconnected. The wireless profilePy and the managing list Ly are similar to the wireless profile Px andthe managing list Ly, respectively, except the point that they areinformation relating to the WFDNW corresponding to MACy. The maximumnumber of a wireless connection (hereinafter referred to as the “maximumnumber corresponding to MACy”) that can be established by the printer PRoperating as the parent station of the WFDNW corresponding to MACy is“1”. Therefore, in the managing list Lx, one MAC address at the maximumis described.

As described above, in the printer PR, the state in which both the WFDNWcorresponding to MACx and the WFDNW corresponding to MACy are present atthe same time can be constructed, and moreover, the maximum numbercorresponding to MACx and the maximum number corresponding to MACy are“1”, respectively. Therefore, the total number of wireless connectionsthat can be established by the printer PR at the same time, that is, anupper limit of wireless connections that can be established by theprinter PR is “2”.

In the wait list WL, one or more pieces of terminal information relatingto one or more wait terminals may be described. The wait terminal is aterminal which waits, after supplying a connection request to theprinter PR, until when a situation is realized where the printer PR iscapable of establishing a wireless connection with the wait terminal.The terminal information includes a rank, a reception ID, and a MACaddress. The rank indicates a priority rank of a connection of the waitterminal (that is, a connection rank). The higher the rank of the waitterminal is (that is, the smaller the numeral indicated by the rank is),the earlier the wireless connection with the printer PR can beestablished. The reception ID is a unique ID generated when the printerPR causes the terminal to wait. The MAC address is the MAC address ofthe wait terminal.

(Configuration of Terminals Ta to Td)

Each of the terminals Ta to Td is a portable terminal apparatus such asa mobile phone (a smart phone, for example), a PDA (abbreviation ofPersonal Digital Assistant), a note PC, a tablet PC, a portable musicreproducing apparatus, a portable video reproducing apparatus, and thelike. One MAC address is allocated to each of the terminals Ta to Td.Each of the MAC addresses of the terminals Ta to Td is described as“MACa”, “MACb”, “MACc”, and “MACd”.

A configuration of the terminal Ta will be explained. The terminals Tbto Tc have the same configurations as that of the terminal Ta. Theterminal Ta includes an operating unit 72, a display unit 74, an NFC I/F78, a wireless LAN IN 80, and a controller 90. Each of the units 72 to90 is connected to a bus line (not shown).

The operating unit 72 comprises a plurality of keys. The user can givevarious instructions to the terminal Ta by operating the operating unit72. The display unit 74 is a display for displaying various kinds ofinformation. The NFC I/F 78 and the wireless LAN I/F 80 are similar tothe NFC I/F 18 and the wireless LAN I/F 20 of the printer PR,respectively. Therefore, the terminal Ta can perform the NFCcommunication and the Wi-Fi communication.

The controller 90 comprises a CPU 92 and a memory 94. The CPU 92 is aprocessor for executing various processes in accordance with each ofprograms 96 and 98 stored in the memory 94.

The OS (abbreviation of Operation System) program 96 is a program forrealizing basic operation of the terminal Ta. The application 98 is aprogram for causing the printer PR to perform printing. The application98 is an application provided by a vendor of the printer PR and it maybe installed in the terminal Ta from a server on the Internet or may beinstalled in the terminal Ta from a medium shipped with the printer PR.

(WFD (Abbreviation of Wi-Fi Direct) Method)

The WFD method is a wireless communication method described in “Wi-FiPeer-to-Peer (P2P) Technical Specification Version 1.1” which is astandard formulated by the Wi-Fi Alliance.

An apparatus which supports the WFD method such as the printer PR andeach of the terminals Ta to Td will be referred to as “WFD apparatuses”below. In the above-described WFD standard, three states, that is, aGroup Owner state (referred to as “(G/O state” below), a client state(referred to as “CL state” below), and a device state are defined as thestates of the WFD apparatus. The WFD apparatus can selectively operatein one of the above three states.

A WFD apparatus in the G/O state (that is, the G/O apparatus) is anapparatus forming a wireless network (that is, WFDNW) in which this WFDapparatus operates as a parent station. A WFD apparatus in the CL state(that is, the CL apparatus) is an apparatus operating as a child stationof the WFDNW. A WFD apparatus in the device state (that is, the deviceapparatus) is an apparatus not belonging to the WFDNW.

A WFDNW to which both the G/O apparatus and the CL apparatus belong isformed by either of the following two procedures, for example. In afirst procedure, a pair of device apparatuses performs a wirelesscommunication called G/O negotiation. As a result, one of the pair ofdevice apparatuses is determined to become the G/O state (that is, theG/O apparatus), while the other is determined to become the CL state(that is, the CL apparatus). Then, the G/O apparatus forms the WFDNW andestablishes a wireless connection with the CL apparatus. As a result,the WFDNW to which both the G/O apparatus and the CL apparatus belong isformed. In a second procedure, the device apparatus does not execute theG/O negotiation but spontaneously proceeds to the G/O state and formsthe WFDNW. In this case, after the WFDNW is formed, another deviceapparatus proceeds to the CL state without executing the G/O negotiationand establishes a wireless connection with the G/O apparatus. As aresult, the WFDNW to which both the G/O apparatus and the CL apparatusbelong is formed.

The G/O apparatus can perform a wireless communication of target datawith the CL apparatus not via another apparatus. The target data is dataincluding information of a network layer of an OSI reference model andinformation of a layer higher than the network layer (an applicationlayer, for example), and the target data includes print datarepresenting an image of a printing target, for example. Moreover, theG/O apparatus can relay a wireless communication of the target databetween the pair of CL apparatuses. As described above, in the WFDNW,each of the apparatuses can perform the wireless communication of thetarget data not via an access point (hereinafter referred to as “AP”)constituted separately from each of the apparatuses. That is, the WFDmethod can be considered as a wireless communication method not usingAP.

Moreover, although the G/O apparatus cannot perform a wirelesscommunication of the target data with the device apparatus not belongingto the WFDNW, the G/O apparatus can establish a wireless connection withthe device apparatus by performing a wireless communication ofconnection data with the device apparatus. As a result, the G/Oapparatus can cause the device apparatus to participate in the WFDNW.

The G/O apparatus can also establish a wireless connection with a legacyapparatus by performing a wireless communication of connection data withthe legacy apparatus not belonging to the WFDNW. As a result, the G/Oapparatus can cause the legacy apparatus to participate in the WFDNW.The legacy apparatus does not support the WFD method but it is anapparatus capable of establishing a wireless connection with for examplean AP in accordance with the Wi-Fi method.

The above connection data is data including information of a layer lowerthan the network layer (a physical layer, a data link layer and thelike, for example) of the OSI reference model (that is, data notincluding the information of the network layer). More specifically, theabove connection data is classified into either of WFD connection dataincluding specific data which is specific to the WFD method and normalconnection data not including the specific data.

The normal connection data includes Probe Request/Response,Authentication Request/Response, Association Request/Response, WSCExchange, 4-Way Handshake and the like, for example. The Probe Requestis a signal for searching an apparatus operating as a parent station ofthe wireless network (G/O apparatus or AP, for example), and the ProbeResponse is its response signal. The Authentication Request is a signalfor confirming an authentication method, and the Authentication Responseis its response signal. The Association Request is a signal forrequesting a connection, and the Association Response is its responsesignal. The WSC Exchange is a signal for supplying various types ofinformation such as a password and the like. The 4-Way Handshake is asignal for executing authentication.

In addition to the above normal connection data, the WFD connectiondata. further includes Invitation Request/Response, Provision DiscoveryRequest/Response and the like, for example, as the specific data whichis specific to the WFD method. The Invitation Request is a signal forinstructing participation in the WFDNW, and the Invitation Response isits response signal. The Provision Discovery Request is a signal forconfirming a method (push-button method, PIN code method and the like,for example) of WPS (abbreviation of Wi-Fi Protected Setup), and theProvision Discovery Response is its response signal.

In general, the normal connection data is data used by the legacyapparatus for establishing a wireless connection with AP. That is, thelegacy apparatus can establish a wireless connection with the AP byperforming a wireless communication of the normal connection data withthe AP and participate as a so-called “station” in the wireless networkformed by the AP. Similarly, the legacy apparatus can establish awireless connection with the G/O apparatus by performing the wirelesscommunication of the normal connection data with the G/O apparatus andparticipate in the WFDNW as a station.

The device apparatus (that is, the apparatus supporting the WFD method)can establish a wireless connection with the G/O apparatus andparticipate in the WFDNW by performing a wireless connection of eitherof the normal connection data and the WFD connection data with the G/Oapparatus depending on the situation. If the device apparatus performs awireless communication only of the normal connection data, the deviceapparatus can be considered to participate in the WFDNW as a station.That is because the device apparatus does not perform a wirelesscommunication of the specific data which is specific to the WFD method.On the other hand, if the device apparatus performs a wirelesscommunication of the WFD connection data, the device apparatus can beconsidered to participate in the WFDNW as a CL apparatus.

As described above, the device apparatus can participate in the WFDNW asa station or can participate in the WFDNW as a CL apparatus. However,below, the station and the CL apparatus are not discriminated but bothare referred to as a “child station”.

(Main Process of Printer PR; FIG. 2)

Contents of the main process executed by the CPU 32 of the printer PRwill be explained by referring to FIG. 2. The main process in FIG. 2 isstarted by using obtainment of an NFC request including a connectionrequest from a terminal (the terminal Ta, for example) as a trigger. Inthe following, a terminal which is a supply source of the NFC request,which is a start trigger of the main process in FIG. 2, would bereferred to as an “object terminal”.

If the user of the object terminal wants to cause the printer PR toperform printing, the user performs in the object terminal an operationof activating the application 98 (see FIG. 1) for the printer PR and anoperation for instructing performance of printing. Subsequently, theuser moves the object terminal close to the printer PR. When a distancebetween the NFC I/F of the object terminal and the NFC I/F 18 of theprinter PR becomes less than a distance (10 cm, for example) capable ofperforming the NFC communication, the NFC connection is establishedbetween these NFC I/Fs. In this case, the object terminal supplies anNFC request including the connection request and the MAC address of theobject terminal itself (MACa, for example) to the printer PR by usingthe NFC connection.

In a case where the NFC request including the connection request isobtained from the object terminal via the NFC I/F 18, the CPU 32 startsthe main process in FIG. 2. In a case where the NFC request is furtherobtained from another terminal while the CPU 32 is executing the mainprocess caused by obtainment of the NFC request from any of theterminals, the CPU 32 starts the main process as another process. Thatis, in a case where a plurality of the NFC requests is simultaneouslyobtained from a plurality of the terminals, the CPU 32 executes aplurality of main processes in accordance with the plurality of NFCrequests in parallel.

At S20, the CPU 32 determines whether or not the total number ofwireless connection (hereinafter referred to as “connection number”)currently established by the printer PR has reached the upper limit “2”.Specifically, the CPU 32 determines that the connection number hasreached the upper limit (Yes at S20) so as to proceed to S30, ifinformation relating to the wireless network (that is, the wirelessprofiles Px and Py and the managing lists Lx and Ly) is stored in eachof the first and second NW storage areas SAx and SAy (see FIG. 1) in thememory 34. Moreover, if the information relating to the wireless networkis not stored in at least one of the first and second NW storage areasSAx and SAy, the CPU 32 determines that the connection number has notreached the upper limit (NO at S20) so as to proceed to S22.

At S22, the CPU 32 newly forms the WFDNW in which the printer PRoperates as the G/O apparatus. The CPU 32 forms the WFDNW correspondingto MACx if neither the WFDNW corresponding to MACx nor the WFDNWcorresponding to MACy is present. Moreover, if only one of the WFDNWcorresponding to MACx and the WFDNW corresponding to MACy is present,the CPU 32 forms the other WFDNW.

Specifically, at S22, the CPU 32 becomes the G/O apparatus of the WFDNWcorresponding to MACx or MACy without executing G/O negotiation andprepares the wireless profile to be used in the WFDNW (that is, theSSID, the authentication method, the encryption method, and thepassword). The CPU 32 generates a unique SSID having not been generatedbefore. The CPU 32 generates the unique SSID by incrementing a numeralincluded in the latest SSID generated before, for example. Moreover, theCPU 32 generates the password by selecting a character string at random,for example. Then, the CPU 32 prepares the authentication method and theencryption method determined in advance.

When the WFDNW corresponding to MACx should be formed, the CPU 32 storesthe prepared wireless profile Px and the managing list Lx in the firstNW storage area SAx. Alternatively, if the WFDNW corresponding to MACyshould be formed, the CPU 32 stores the prepared wireless profile Py andthe managing list Ly in the second NW storage area SAy. In this stage, aMAC address is not described yet in the managing list Lx or the managinglist Ly.

As described above, at S22, the printer PR does not re-use an oldwireless profile having been used in the past WFDNW but prepares a newwireless profile including a new SSID and password. Thus, it is capableof inhibiting that a terminal different from the object terminalparticipates in the WFDNW formed at S22 by re-establishing the wirelessconnection with the printer PR by using the old wireless profile.Therefore, the printer PR can appropriately establish the wirelessconnection with the object terminal by using the new wireless profile.

At S24, the CPU 32 supplies an NFC response including the SSID and thepassword generated at S22 to the object terminal via the NFC I/F 18. Asa result, the CPU 32 can notify the object terminal that the wirelessconnection with the printer PR should be established by using the SSIDand the password. It should be noted that the NFC response supplied atS24 will be referred to as a “NFC response for connecting” hereinafter.

At S26, the CPU 32 executes a first communication process which will bedescribed later (see FIG. 3), so as to establish a wireless connectionwith the object terminal. As a result, the CPU 32 causes the objectterminal to participate as a child station in the WFDNW formed at S22and obtains print data from the object terminal. When S26 is finished,the process in FIG. 2 is finished.

On the other hand, at S30 (that is, if the connection number has reachedthe upper limit), the CPU 32 prepares terminal information (that is, therank, the reception ID, and the MAC address) so as to describe theterminal information in the wait list WL (see FIG. 1) in the memory 34.Specifically, the CPU 32 determines the rank by incrementing “1” to thelowest rank (that is, the rank indicating the largest numeral) currentlydescribed in the wait list WL. The CPU 32 generates the unique receptionID by incrementing the numeral included in the latest reception IDgenerated before, for example. The CPU 32 extracts the MAC address ofthe object terminal from the obtained NFC request Which is the triggerfor starting the process in FIG. 2. Then, the CPU 32 describes theterminal information including the determined rank, the generatedreception ID, and the extracted MAC address in the wait list WL.

At S32, the CPU 32 supplies the NFC response including the rank and thereception ID described at S30 to the object terminal via the NEC I/F 18.The NFC response does not include an SSID or a password unlike the NFCresponse at S24, As a result, the CPU 32 can notify the object terminalthat it should wait until a situation is realized where the printer PRis capable of establishing a wireless connection with the objectterminal. It should be noted that the NFC response supplied at S32 willbe referred to as an “NFC response for waiting”, and the reception IDsupplied to the object terminal at S32 as an “object reception ID”hereinafter. Subsequently, the CPU 32 sequentially executes monitoringprocesses at S40, S50, and S60.

At S40, the CPU 32 monitors disconnection of any of the wirelessconnection currently established by the printer PR. If the wirelessprofile and the managing list are deleted from either of the first andsecond NW storage areas SAx and SAy in the memory 34, the CPU 32determines that the wireless connection is disconnected (YES at S40) soas to proceed to S42.

At S42, the CPU 32 refers to the wait list WL in the memory 34 anddetermines whether or not the object reception ID is associated with thehighest rank “1” in the wait list WL. If the CPU 32 determines that theobject reception ID is associated with the highest rank (YES at S42),the CPU 32 proceeds to S46. If the CPU 32 determines that the objectreception ID is not associated with the highest rank (NO at S42), theCPU 32 proceeds to the monitoring process at S50 and S60 withoutexecuting S46.

At S46, the CPU 32 executes a second communication process which will bedescribed later (see FIG. 4), so as to establish a wireless connectionwith the object terminal. As a result, the CPU 32 may cause the objectterminal to participate as a child station in the WFDNW formed at S80 inFIG. 4 which will be described later and obtain print data from theobject terminal. When S46 is finished, the process in FIG. 2 isfinished.

At S50, the CPU 32 monitors obtainment of the NFC request including theobject reception ID and a cancel request from the object terminal viathe NFC I/F 18. If the NFC request is to be obtained (YES at S50), theCPU 32 proceeds to S52.

At S52, the CPU 32 deletes the terminal information including the objectreception ID (that is, the rank, the object reception ID, the MACaddress of the object terminal) from the wait list WL (see FIG. 1). Ifthere are one or more pieces of terminal information including the rankslower than that of the deleted terminal information in the wait list WL,the CPU 32 moves up each of the ranks included in the one or more piecesof terminal information. When S52 is finished, the process in FIG. 2 isfinished.

At S60, the CPU 32 monitors obtainment of the NFC request including theobject reception ID and a situation confirmation request from the objectterminal via the NFC I/F 18. In a case where the NFC request is obtained(YES at S60), the CPU 32 proceeds to S62.

At S62, the CPU 32 obtains the rank associated with the object receptionID from wait list WL (see FIG. 1).

Subsequently, at S64, the CPU 32 supplies the NFC response including theobtained rank to the object terminal via the NFC I/F 18. When S64 isfinished, the CPU 32 returns to the monitoring process at S40.

(First Communication Process; FIG. 3)

Contents of the first communication process executed at S26 in FIG. 2will be explained by referring to FIG. 3. In the first communicationprocess, the CPU 32 executes each of the following communication (S70,S72 and the like) by using the MAC address (that is, MACx or MACy)corresponding to the WFDNW formed at S22 in FIG. 2 (hereinafter simplyreferred to as “WFDNW of S22”) as the MAC address of the printer PR.That is, each signal supplied to the object terminal from the printer PRincludes the MAC address corresponding to the WFDNW of S22 as the MACaddress of a supply source. Each signal supplied from the objectterminal to the printer PR includes the MAC address of the objectterminal as the MAC address of the supply source.

At S70, the CPU 32 executes a first type of a connection process withthe object terminal via the wireless LAN I/F 20 so as to establish awireless connection with the object terminal. Specifically, the CPU 32obtains the Probe Request from the object terminal and supplies theProbe Response to the object terminal. The Probe Request includes theSSID supplied to the object terminal at S24 in FIG. 2. The ProbeResponse includes the authentication method and the encryption methodstored in the memory 34 at S22 in FIG. 2. As a result, notification canbe made to the object terminal that the authentication method and theencryption method should be used. Subsequently, the CPU 32 sequentiallyobtains the Authentication Request and the Association Request from theobject terminal and sequentially supplies the Authentication Responseand the Association Response to the object terminal. Then, the CPU 32executes the 4-way handshake with the object terminal.

When the first type of connection process at S70 is finished, thewireless connection with the object terminal is established. As aresult, the CPU 32 can cause the object terminal to participate in theWFDNW of S22 as a child station (more specifically, as a station). Then,the CPU 32 describes the MAC address of the object terminal included ineach signal obtained in the first type of connection process in themanaging list stored at S22 in FIG. 2 (that is, the managing list Lx orLy in FIG. 1).

At S72, the CPU 32 obtains the print data from the object terminal viathe wireless LAN I/F 20 by using the WFDNW of S22.

At S74, the CPU 32 supplies the obtained print data to the printperforming unit 16 (see FIG. 1). As a result, the print performing unit16 prints an image represented by the obtained print data on a printmedium.

At S76, the CPU 32 obtains a disconnection request from the objectterminal via the wireless LAN I/F 20. The disconnection request is asignal for requesting disconnection of the wireless connection andincludes the MAC address corresponding to the WFDNW of S22 as the MACaddress of the supply destination. Therefore, if there are two WFDNW,the CPU 32 can know that the WFDNW of S22 should be made to disappear onthe basis of the MAC address of the supply destination included in thedisconnection request.

At S78, the CPU 32 disconnects the wireless connection with the objectterminal and causes the WFDNW of S22 to disappear. Specifically, the CPU32 first supplies the response signal to the disconnection request tothe object terminal via the wireless LAN I/F 20, so as to disconnect thewireless connection with the object terminal. Subsequently, the CPU 32deletes from the memory 34 the wireless profile and the managing listdescribed in the memory 34 at S22 in FIG. 2. As a result, the WFDNW ofS22 disappears. When S78 is finished, the process in FIG. 3 is finished.

(Second Communication Process; FIG. 4)

Contents of the second communication process executed at S46 in FIG. 2will be explained by referring to FIG. 4. At S80, the CPU 32 newly formsa WFDNW. Here, the method for forming the WFDNW is similar to that atS22 in FIG. 2.

The CPU 32 executes each of the following communication (S84, S90, S92and the like) by using the MAC address (that is, MACx or MACy)corresponding to the WFDNW formed at S80 (hereinafter simply referred toas “WFDNW of S80”) as the MAC address of the printer PR. That is, eachsignal supplied to the object terminal from the printer PR includes theMAC address corresponding to the WFDNW of S80 as the MAC address of asupply source.

At S82, the CPU 82 obtains the MAC address associated with the highestrank “1” from the wait list WL (see FIG. 1). As described above, if theterminal information of the object terminal is determined to be thehighest rank in the wait list WL at S42 in FIG. 2 (YES at S42), theprocess in FIG. 4 is executed. Therefore, the MAC address obtained atS82 is the MAC address of the object terminal.

At S84, the CPU 32 supplies the Invitation Request which is a signal forinstructing participation in the WFDNW of S80 via the wireless LAN I/F20 to the object terminal. The Invitation Request includes the MACaddress obtained at S82 as the MAC address of the supply destination. Inthis way, according to this embodiment, the printer PR can supply theInvitation Request, which is a trigger for the object terminal toparticipate in the WFDNW, to the object terminal immediately after theconnection number changes to the number less than the upper limit. Thus,the printer PR can cause the object terminal to rapidly participate inthe WFDNW.

At S86, the CPU 32 deletes the terminal information including thehighest rank “1” from the wait list WL (see FIG. 1), That is, the CPU 32deletes the terminal information of the object terminal from the waitlist WL. If there are one or more pieces of terminal informationincluding the ranks lower than that of the deleted terminal informationin the wait list WL, the CPU 32 moves up each of the ranks included inthe one or more pieces of terminal information.

At S88, the CPU 32 determines whether or not to obtain the InvitationResponse from the object terminal. If the CPU 32 obtains the InvitationResponse via the wireless LAN I/F 20 (YES at S88), the CPU 32 proceedsto S90.

At S90, the CPU 32 establishes the wireless connection with the objectterminal by executing the second type of connection process with theobject terminal via the wireless LAN I/F 20. The second type ofconnection process includes a first partial process and a second partialprocess. The first partial process is a process of supplying thewireless profile of the WFDNW of S80 to the object terminal. Under asituation in which S90 is executed, unlike the situation in which S70 inFIG. 3 is executed, the SSID and the password have not been supplied.yet from the printer PR to the object terminal. Therefore, at S90, theCPU 32 executes the first partial process so as to supply the wirelessprofile including the SSID and the password of the WFDNW of S80 to theobject terminal. The second partial process is a process forestablishing the wireless connection with the object terminal by usingthe wireless profile supplied in the first partial process.

In the first partial process, the CPU 32 obtains the Provision DiscoveryRequest from the object terminal and supplies the Provision DiscoveryResponse to the object terminal. The Provision Discovery Responseincludes information indicating the PBC (abbreviation of Push ButtonConfiguration) method of the WPS. As a result, notification can be madeto the object terminal that the PBC method of the WPS should beexecuted. Subsequently, the CPU 32 obtains the Probe Request from theobject terminal and supplies the Probe Response to the object terminal.The Probe Response includes the SSID of the WFDNW of S80 and thepredetermined authentication method and encryption method. As a result,notification can be made to the object terminal that each of thesepieces of information should be used. The above predeterminedauthentication method and encryption method are an authentication methodand an encryption method used temporarily to execute WSC Exchange,unlike the authentication method and encryption method used in the WFDNWof S80.

Subsequently, the CPU 32 sequentially obtains the Authentication Requestand the Association Request from the object terminal and sequentiallysupplies the Authentication Response and the Association Response to theobject terminal. As a result, preparation for execution of the WSCExchange is completed. Then, the CPU 32 executes the WSC Exchange andsupplies each information used in the WFDNW of S80 (that is, theauthentication method, the encryption method, and the password) to theobject terminal.

In the second partial process, the CPU 32 establishes the wirelessconnection with the object terminal by using the wireless profile of theWFDNW of S80 supplied in the first partial process. Specifically, theCPU 32 sequentially obtains the Authentication Request and theAssociation Request from the object terminal and sequentially suppliesthe Authentication Response and the Association Response to the objectterminal. Then, the CPU 32 executes the 4-way handshake with the objectterminal.

When the above second type of connection process is finished, thewireless connection with the object terminal is established. As aresult, the CPU 32 can cause the object terminal to participate in theWFDNW of S80 as a child station (more specifically, as a CL apparatus).Then, the CPU 32 describes the MAC address of the object terminalincluded in each signal obtained in the second type of connectionprocess in the managing list (that is, the managing list Lx or Ly inFIG. 1) stored at S80.

S92 to S98 are similar to S72 to S78 in FIG. 3. However, at S92, the CPU32 obtains the print data from the object terminal by using the WFDNW ofS80. Moreover, at S98, the CPU 32 deletes from the memory 34 thewireless profile and the managing list described in the memory 34 at S80and causes the WFDNW of S80 to disappear. When S98 is finished, theprocess in FIG. 4 is finished.

In a case where the Invitation Response is not obtained even after apredetermined time has elapsed, since the Invitation Request wassupplied at S84 (NO at S88), the CPU 32 skips S90 to S96 and proceeds toS98. The Invitation Response is not obtained, for example, if the objectterminal moves to a position considerably away from the printer PR or ifthe user of the object terminal does not execute a connection permitoperation in the object terminal in response to the Invitation Request.

(Application Process at Terminal; FIG. 5)

Contents of an application process executed by the CPU 92 of theterminal Ta will be explained by referring to FIG. 5. The otherterminals Tb to Td also execute the application process similarly to theterminal Ta.

When an application activation operation and a printing operation areexecuted in the operating unit 72 by the user, the CPU 92 of theterminal Ta starts the process in FIG. 5 in accordance with theapplication 98. The application activation operation is an operation foractivating the application 98 when the user wants to cause the printerPR to perform printing. The print operation is an operation by the userof designating print data representing an image to be printed from thememory 94 of the terminal Ta and instructing performance of printing.

At S100, the CPU 92 causes the display unit 74 to display a message toencourage the terminal Ta to be moved close to the printer PR. As aresult, the user moves the terminal Ta close to the printer PR. As aresult, the NEC connection is established between the NFC I/F 78 of theterminal Ta and the NFC I/F 18 of the printer PR.

At S102, the CPU 92 supplies, via the NFC I/F 78 to the printer PR, theNEC request including the connection request for the wireless connectionvia the wireless LAN 80 and MACa.

At S104, the CPU 92 obtains the NFC response from the printer PR via theNFC I/F 78. The NFC response is either of the NFC response including theSSID and the password at S24 in FIG. 2 (that is, the NFC response forconnecting) and the NFC response including the reception ID and the rankat S32 (that is, the NFC response for waiting).

At S106, the CPU 92 determines whether the obtained NFC response is theNFC response for connecting or the NFC response for waiting. If the CPU92 determines that the obtained NFC response is the NEC response forconnecting (YES at S106), the CPU 92 proceeds to S108.

At S108, the CPU 92 executes the first type of connection process withthe printer PR via the wireless LAN I/F 80, so as to establish thewireless connection with the printer PR. The operation executed by theCPU 92 at S108 is similar to the operation of the object terminalexplained at S70 in FIG. 3. When the first type of connection process atS108 is finished, the wireless connection with the printer PR isestablished. As a result, the terminal Ta participates as a childstation (more specifically, as a station) in the WFDNW in which theprinter PR operates as the G/O apparatus (that is, the WFDNW of S22 inFIG. 2).

At S110, the CPU 92 supplies the print data designated by the user tothe printer PR via the wireless LAN I/F 80 by using the WFDNW in whichthe CPU 92 participated at S108. When the CPU 92 completes supply of allthe print data to the printer PR, the CPU 92 proceeds to S112.

At S112, the CPU 92 supplies the disconnection request to the printer PRvia the wireless LAN I/F 80. As a result. the CPU 92 can disconnect thewireless connection with the printer PR. When S112 is finished, theprocess in FIG. 5 is finished.

On the other hand, if the CPU 92 determines at S106 that the obtainedNFC response is the NFC response for waiting (NO at S106), the CPU 92proceeds to S120 and executes a wait process which will be describedlater (see FIG. 6). When the wait process is finished, the process inFIG. 5 is finished.

(Wait Process; FIG. 6)

Contents of the wait process executed at S120 in FIG. 5 will beexplained by referring to FIG. 6. At S130, the CPU 92 causes the displayunit 74 to display a message and the rank included in the obtained NFCresponse for waiting. This message indicates that it should wait untilwhen the situation is realized where the printer PR is capable ofestablishing the wireless connection with the terminal Ta. As a result,the user can know that the user should wait and also can know that onwhat rank the terminal Ta can establish the wireless connection with theprinter PR. Subsequently, the CPU 92 sequentially executes themonitoring processes at S140, S150, and S160.

At S140, the CPU 92 monitors that a situation confirmation operation isexecuted by the user. If a button indicating “situation confirmation” isselected by the user, the CPU 92 determines that the situationconfirmation operation is performed (YES at S140), so as to proceed toS142.

At S142, the CPU 92 causes the display unit 74 to display a message toencourage the terminal Ta to be moved close to the printer PR. As aresult, the user moves the terminal Ta close to the printer PR, and theNFC connection is established between the terminal Ta and the printerPR.

At S144, the CPU 92 supplies, via the NFC I/F 78 to the printer PR, theNFC request including the reception ID included in the obtained NFCresponse for waiting and the situation confirmation request.

At S146, the CPU 92 obtains the NFC response (see S64 in FIG. 2)including the rank from the printer PR via the NFC I/F 78.

At S148, the CPU 92 causes the display unit 74 to display the rankincluded in the NFC response obtained at S146. As a result, the user canknow on what rank the terminal Ta can establish the wireless connectionwith the printer PR. When S148 is finished, the CPU 92 returns to S140.

At S150, the CPU 92 monitors that a cancel operation is executed by theuser. If a button indicating “cancel” is selected by the user, the CPU92 determines that the cancel operation is executed (YES at S150), so asto proceed to S152.

At S152, the CPU 92 causes the display unit 74 to display a message toencourage the terminal Ta to be moved close to the printer PR. As aresult, the user moves the terminal Ta close to the printer PR. As aresult, the user moves the terminal Ta close to the printer PR. andthus, the NFC connection is established between the terminal Ta and theprinter PR.

At S154, the CPU 92 supplies, via the NFC I/F 78 to the printer PR, theNFC request including the reception ID included in the obtained NFCresponse for waiting and the cancel request. As a result, the CPU 92 cancancel a plan of establishment of the wireless connection with theprinter PR (see S52 in FIG. 2). When S154 is finished, the process inFIG. 6 is finished.

At S160, the CPU 92 monitors obtainment of the Invitation Requestincluding MACa from the printer PR via the wireless LAN I/F 80, If theCPU 92 obtains the Invitation Request including MACa (YES at S160), theCPU 92 proceeds to S162.

At S162, the CPU 92 causes the display unit 74 to display a message forinquiring the user whether or not to establish the wireless connectionwith the printer PR. Then, the CPU 92 monitors execution of theconnection permit operation by the user. If a button indicating“connection permit” is selected by the user, the CPU 92 determines thatthe connection permit operation is executed (YES at S162), so as toproceed to S164. If a button indicating “connection refusal” is selectedby the user, the CPU 92 determines that the connection permit operationwas not executed (NO at S162), so as to finish the process in FIG. 6.

At S164, the CPU 92 supplies the Invitation Response to the printer PRvia the wireless LAN I/F 80.

At S166, the CPU 92 executes the second type of connection process withthe printer PR, so as to establish a wireless connection with theprinter PR via the wireless LAN I/F 80. The operation executed by theCPU 92 at S166 is similar to the operation of the object terminalexplained at S90 in FIG. 4. When the second type of connection processat S166 is finished, the wireless connection with the printer PR isestablished. As a result, the terminal Ta can participate as a childstation (more specifically, a CL apparatus) in the WFDNW (that is, theWFDNW formed at S80 in FIG. 4) in which the printer PR operates as theG/O apparatus.

At S158, the CPU 92 supplies the print data designated by the user tothe printer PR via the wireless LAN I/F 80 by using the WFDNW in whichthe CPU 92 participated at S166. When the CPU 92 has supplied all theprint data to the printer PR, the CPU 92 proceeds to S170.

At S170, the CPU 92 supplies the disconnection request to the printer PRvia the wireless LAN I/F 80. As a result, the CPU 92 can disconnect thewireless connection with the printer PR. When S170 is finished, theprocess in FIG. 6 is finished.

(Specific Cases)

Subsequently, specific cases realized by the flowcharts in FIGS. 2 to 6will be explained by referring to FIGS. 7 to 9. In FIGS. 7 to 9, arrowsof broken lines between each of the apparatuses indicate the NFCcommunication, and arrows of solid lines indicate the Wi-Ficommunication.

(Case A; FIG. 7)

A state in which the printer PR sequentially establishes the wirelessconnection with two terminals Ta and Tb will be explained by referringto FIG. 7. In an initial state in FIG. 7, the connection number of theprinter PR is zero.

At T10, the user of the terminal Ta executes the application activationoperation and the printing operation to the terminal Ta (trigger forstarting the process in FIG. 5) and moves the terminal Ta close to theprinter PR. In this case, at T20, the terminal Ta supplies the NFCrequest including the connection request and MACa to the printer PR(S102 in FIG. 5).

At T20, in a case where the NFC request including the connection requestis obtained from the terminal Ta (trigger for starting the process inFIG. 2), the printer PR determines that the connection number of theprinter PR has not reached the upper limit (NO at S20 in FIG. 2). Inthis case, at T22, the printer PR newly forms a first WFDNWcorresponding to MACx (S22). Here, the printer PR generates an SSID“aaa” and a password “Pa”. Then, at T24, the printer PR supplies the NFCresponse for connecting including the SSID “aaa” and the password “Pa”to the terminal Ta (S24).

Subsequently, at T26, the printer PR and the terminal Ta execute thefirst type of connection process and establish the wireless connection(S70 in FIG. 3, S108 in FIG. 5). As a result, the terminal Taparticipates as a child station in the first WFDNW in which the printerPR operates as the G/O apparatus.

At T28, the printer PR obtains the print data from the terminal Ta byusing the first WFDNW (S72 in FIG. 3). If the data size of the printdata is relatively large, for example, a long time is required forcommunication of the print data. In this case, the wireless connectionbetween the printer PR and the terminal Ta is maintained for a longtime. In the case A, in a state where the wireless connection ismaintained between the printer PR and the terminal Ta, that is, in astate where the first WFDNW is maintained, the NFC request including theconnection request is supplied from the terminal Tb to the printer PR aswill be explained later.

At T30, the user of the terminal Tb executes the application activationoperation and the printing operation to the terminal Tb (trigger forstarting the process in FIG. 5) and moves the terminal Tb close to theprinter PR. In this case, at T40, the terminal Tb supplies the NFCrequest including the connection request and MACb to the printer PR(S102 in FIG. 5).

At T40, in a case where the NFC request including the connection requestis obtained from the terminal Tb (trigger for starting the process inFIG. 2), the printer PR determines that the connection number of theprinter PR has not reached the upper limit (NO at S20 in FIG. 2). Inthis case, at T42, the printer PR newly limns a second WFDNWcorresponding to MACy (S22). Here, the printer PR generates an SSID“bbb” different from the SSID “aaa” of the first WFDNW and furthergenerates a password “Pb”. Then, at T44, the printer PR supplies the NFCresponse for connecting including the SSID “bbb” and the password “Pb”to the terminal Tb (S24).

Subsequently, at T46, the printer PR and the terminal Tb execute thefirst type of connection process and establish the wireless connection(S70 in FIG. 3, S108 in FIG. 5). As a result, the terminal Tbparticipates as a child station in the second WFDNW in which the printerPR operates as the G/O apparatus.

At T48, the printer PR obtains the print data from the terminal Tb byusing the second WFDNW (S72 in FIG. 3).

(Effect of Case A)

The printer PR determines that the connection number has not reached theupper limit in the case where the NFC request including the connectionrequest is obtained from the terminal Ta. In this case, the printer PRforms the first WFDNW so as to establish the wireless connection withthe terminal Ta. As a result, the terminal Ta operates as a childstation of the first WFDNW. Moreover, in the case where the NFC requestincluding the connection request is obtained from the terminal Tb in thestate of the first WFDNW being formed, the printer PR determines thatthe connection number has not reached the upper limit. In this case,while the state in which the first WFDNW is formed is maintained, theprinter PR newly forms the second WFDNW different from the first WFDNWso as to establish the wireless connection with the terminal Tb. As aresult, the terminal Tb operates as the child station of the secondWFDNW. As described above, the printer PR can construct the state inwhich both the first and second WFDNW in Which the printer PR itselfoperates as the G/O apparatus are present at the same time. Thus, theprinter PR. can obtain the print data from the terminal Ta by using thefirst WFDNW and can obtain the print data from the terminal Tb by usingthe second WFDNW. The printer PR can perform the wireless communicationwith the plurality of terminals Ta and Tb by using the new method.

Assume that the printer PR employs a method of forming only one WFDNWand establishing a wireless connection with a plurality of terminalsmatching the upper limit. According to this method, a situation in whicheach of the plurality of terminals participates in the one WFDNW as achild station at the same time can be constructed. In the state wherethe plurality of child stations belong to the same WFDNW as describedabove, a communication using the WFDNW may be performed among the childstations. Therefore, a first child station may make an improper accessto information stored in a second child station, for example. That is,in the state where the plurality of child stations belongs to the sameWFDNW, a security problem may occur. In general, the larger the numberof the child stations belonging to the same WFDNW becomes, the lower thesecurity may become.

On the other hand, in the method of this embodiment, as illustrated inthe case A, the printer PR causes the terminal Ta to participate in thefirst WFDNW as the child station and causes the terminal Tb toparticipate in the second WFDNW different from the first WFDNW as thechild station. That is, the situation does not occur in which theplurality of child stations matching the upper limit belongs to the sameWFDNW at the same time, and as a result, security can be improved.Particularly, in this embodiment, the maximum number of the childstation capable of belonging to the first WFDNW and the maximum numberof the child station capable of belonging to the second WFDNW are both“1”. Thus, since two or more child stations cannot belong to one WFDNWformed by the printer PR, security can be further improved.

(Case B; FIG. 8)

Fig, 8 illustrates a sequence chart continued from FIG. 7. In theinitial state in FIG. 8, the printer PR establishes both the wirelessconnection with the terminal Ta and the wireless connection with theterminal Tb. That is, the connection number of the printer PR hasreached the upper limit.

At T50, the user of the terminal Tc executes the application activationoperation and the printing operation to the terminal Tc (trigger forstarting the process in FIG. 5) and moves the terminal Tc close to theprinter PR. In this case, at T60, the terminal Tc supplies the NFCrequest including the connection request and MACc to the printer PR(S102 in FIG. 5).

At T60, in a case where the NFC request including the connection requestis obtained from the terminal Tc (trigger for starting the process inFIG. 2), the printer PR. determines that the connection number of theprinter PR has reached the upper limit (YES at S20 in FIG. 2). In thiscase, the printer PR describes the terminal information including therank “1”, the reception ID “001”, and MACc in the wait list WL (S30).Then, at T62, the printer PR supplies the NFC response for waitingincluding the rank “1” and the reception ID “001” to the terminal Tc(S32).

At T52, the terminal Tc displays the rank “1” included in the NFCresponse for waiting obtained from the printer PR (S130 in FIG. 6). As aresult, the user of the terminal Tc can know that the terminal Tc hasthe first connection rank.

After that, at T70, the user of the terminal Td executes the applicationactivation operation and the printing operation to the terminal Td(trigger for starting the process in FIG. 5) and moves the terminal Tdclose to the printer PR. In this case, at T80, the terminal Td suppliesthe NFC request including the connection request and MACd to the printerPR (S102 in FIG. 5).

At T80, in a case where the NFC request including the connection requestis obtained from the terminal Td (trigger for starting the process inFIG. 2), the printer PR determines that the connection number of theprinter PR has reached the upper limit (YES at S20 in FIG. 2). In thiscase, the printer PR describes the terminal information including therank “2”, the reception ID “002”, and MACd in the wait list WL (S30).Then, at T82, the printer PR supplies the NFC response for waitingincluding the rank “2” and the reception ID “002” to the terminal Td(S32).

At T82, the terminal Td displays the rank “2” included in the NFCresponse for waiting obtained from the printer PR (S130 in FIG. 6). As aresult, the user of the terminal Td can know that the terminal Td hasthe second connection rank.

After that, at T90, the printer PR obtains a disconnection request fromthe terminal Ta (S76 in FIG. 3). In this case, at T100, the printer PRdisconnects the wireless connection with the terminal Ta so as to causethe first WFDNW to disappear (S78). As a result, the connection numberof the printer PR becomes less than the upper limit. Then, at T102, theprinter PR newly forms a third WFDNW corresponding to MACx (S80 in FIG.4). Here, the printer PR generates an SSID “ccc” different from each ofthe SSID of the first and second WFDNW and further generates a password“Pc”.

Subsequently, at T104, the printer PR obtains MACc of the terminal Tcassociated with the highest rank “1” from the wait list WL (S82) andsupplies the Invitation Request including MACc to the terminal Tc (S84).Then, the printer PR deletes the terminal information of the terminal Tcfrom the wait list WL (S86). As a result, a state where only theterminal information. of the terminal Td is described in the wait listWL is realized.

At T106, the user of the terminal Tc executes the connection permitoperation to the terminal Tc (YES at S162 in FIG. 6). In this case, atT108, the terminal Tc supplies the Invitation Response to the printer PR(S164).

At T110, the printer PR and the terminal Tc execute the second type ofconnection process so as to establish the wireless connection (S90 inFIG. 4, S166 in FIG. 6). As a result, the terminal Tc participates as achild station in the third WFDNW in which the printer PR operates as theG/O apparatus.

At T112, the printer PR obtains the print data from the terminal Tc byusing the third WFDNW (S92 in FIG. 4).

At T120, the user of the terminal Td executes the situation confirmationoperation to the terminal Td (YES at S140 in FIG. 6) and moves theterminal Td close to the printer PR. In this case, at T122, the terminalTd supplies the NFC request including the situation confirmation requestand the reception ID “002” to the printer PR (S144 in FIG. 6).

At T122, in a case where the NFC request including the situationcontinuation request and the reception ID “002” are obtained from theterminal Td (YES at S60 in FIG. 2), the printer PR obtains the rank “1”associated with the reception ID “002” from the wait list WL (S62).Then, at T124, the printer PR supplies the NFC response including therank “1” to the terminal Td (S64).

At T126, the terminal Td displays the rank “1” included in the NFCresponse Obtained from the printer PR (S148 in FIG. 6). As a result, theuser of the terminal. Td can know that the connection rank of theterminal Td has moved up from the second to the first.

(Effect of Case B)

In a case where the NFC request including the connection request isobtained from the terminal Tc in the state of the connection numberreaching the upper limit, the printer PR supplies the NFC response forwaiting to the terminal Tc. As a result, the terminal Tc can be made towait for a situation where the printer PR is capable of establishing thewireless connection with the terminal Tc. Then, if the wirelessconnection with the terminal Ta in which the printer PR operates as thechild station of the first WFDNW is disconnected and the connectionnumber becomes less than the upper limit, the printer PR newly forms thethird WFDNW and supplies the Invitation Request including MACc to theterminal Tc. As a result, the printer PR can establish the wirelessconnection with the terminal Tc and can obtain the print data from theterminal Tc by using the third WFDNW. That is, in the case where the NFCrequest including the connection request is obtained from the terminalTc in the state of the connection number reaching the upper limit, theprinter PR can appropriately perform the wireless communication with theterminal Tc.

Moreover, when the wireless connection with the terminal Ta isdisconnected, the printer PR establishes the wireless connection withthe terminal Tc on a priority basis which has supplied the NFC requestincluding the connection request earlier than the terminal Td. Thus, theterminal Tc does not have to be made to wait for a long time.

(Case C; FIG. 9)

FIG. 9 illustrates a sequence chart continued from FIGS. 7. T50 to T82in Fig, 9 are similar to T50 to T82 in FIG. 8.

At T130, the user of the terminal Tc executes the cancel operation tothe terminal Tc (YES at S150 in FIG. 6) and moves the terminal Tc closeto the printer PR. In this case, at T132, the terminal Tc supplies theNFC request including the cancel request and the reception ID “001” tothe printer PR (S154 in FIG. 6).

At T132, in a case where the NFC request including the cancel requestand the reception ID “001” are obtained from the terminal Tc (YES at S50in FIG. 2), the printer PR deletes the terminal information of theterminal Tc including the reception ID “001” from the wait list WL(S52). As a result, the state in Which only the terminal information ofthe terminal Td is described in the wait list WL is realized.

After that, at T140, the user of the terminal Td executes the situationconfirmation operation to the terminal Td (YES at S140 in FIG. 6) andmoves the terminal Td close to the printer PR. In this case, at T142,the terminal Td supplies the NFC request including the situationconfirmation request and the reception ID “002” to the printer PR (S144in FIG. 6).

At T142, in a case where the NFC request including the situationcontinuation request and the reception ID “002” are obtained from theterminal Td (YES at S60 in FIG. 2), the printer PR obtains the rank “1”associated with the reception ID “002” from the wait list WL (S62).Then, at T144, the printer PR supplies the NFC response including therank “1” to the terminal Td (S64).

At T146, the terminal Td displays the rank “1” included in the NFCresponse obtained from the printer PR (S148 in FIG. 6). As a result, theuser of the terminal Td can know that the connection rank of theterminal Td moves up from the second to the first.

T90 to T102 are similar to T90 to T102 in FIG. 8. At T164, the printerPR obtains MACd of the terminal Td associated with the highest rank “1”from the wait list WL (S82) and supplies the Invitation Requestincluding MACd to the terminal Td (S84). Then, the printer PR deletesthe terminal information of the terminal Td from the wait list WL (S86).As a result, the state in which no terminal information is described inthe wait list WL, that is, the state in which no terminal is waiting isrealized.

At T166, the user the user of the terminal Td executes the connectionpermit operation to the terminal Td (YES at S162 in FIG. 6). In thiscase, at T168, the terminal Td supplies the Invitation Response to theprinter PR (S164).

At T170, the printer PR and the terminal Td execute the second type ofconnection process and establish the wireless connection (S90 in FIG. 4,S166 in FIG. 6). As a result, the terminal Td participates as a childstation in the third WFDNW in which the printer PR operates as the G/Oapparatus.

At T172, the printer PR obtains the print data from the terminal Td byusing the third WFDNW (S92 in FIG. 4).

Effect of Case C)

In the case C, in the case where the NFC request including theconnection request is obtained from the terminal Td in the state of theconnection number reaching the upper limit, the printer PR canappropriately perform the wireless communication with the terminal Td.Moreover, in the case where the cancel request is obtained from theterminal Tc, the printer PR can cancel a plan of establishment of thewireless connection with the terminal Tc by deleting the terminalinformation of the terminal Tc from the wait list WL. Thus, when thewireless connection with the terminal Ta is disconnected, the printer PRcan appropriately establish the wireless connection with the terminalTd.

Moreover, in this embodiment, not only the rank and the MAC address butthe unique reception ID is described in the wait list WL. Thus, thefollowing effect can be obtained. For example, assume a situation wherethe printer PR sequentially obtains the NFC request including theconnection request from the terminal Tc twice and sequentially suppliesthe NFC response for waiting to the terminal Tc twice. In this case, twopieces of terminal information including the same MAC address (that is,MACc) are sequentially described in the wait list WL. The above twopieces of terminal information include unique reception IDs,respectively. Therefore, in a case where the NFC request including thecancel request or the situation confirmation request is obtained fromthe terminal Tc, the printer PR can discriminate to which of the twopieces of terminal information the NFC request is a target based on thereception ID included in the NFC request.

(Correspondence)

The printer PR, the wireless LAN I/F 20, and the NFC I/F 18 are examplesof the “communication apparatus”, the “first interface”, and the “secondinterface”, respectively. In the case B in FIG. 8, the terminal Ta, theterminal Tc, and the terminal Td are examples of the “specific externalapparatus”, the “first external apparatus”, and the “second externalapparatus”, respectively. The NFC request at T60 and the NFC request atT80 are examples of the “first wireless connection request” and the“second wireless connection request”, respectively, The NFC response forwaiting at T62 and the NFC response for waiting at T82 are examples ofthe “first wait information” and the “second wait information”,respectively. The first WFDNW and the third WFDNW are examples of the“first wireless network” and the “second wireless network”,respectively. The Invitation Request at T104 is an example of“instruction information” for instructing to participate as a childstation.

In another aspect, in the case B in FIG. 8, the terminal Td and the NFCrequest at T80 are examples of the “first external apparatus” and the“first wireless connection request”, respectively. In this case, the NFCresponse for waiting at T82 and the NFC request at T122 are examples ofthe “first wait information” and the “first inquiry”, respectively. Therank “2” included in the NFC response for waiting at 182 and the rank“1” included in the NFC response at T124 are examples of the “firstnumber information” and the “second number information”, respectively.

In the case A in FIG. 7, the terminal Tb and the NFC request at T40 areexamples of the “first external apparatus” and the “first wirelessconnection request”, respectively. In this case, the first WFDNW and thesecond WFDNW are examples of the “first wireless network” and the “thirdwireless network”, respectively.

In the case C in FIG. 9, the terminal Td and the NFC request at T80 areexamples of the “first external apparatus” and the “first wirelessconnection request”, respectively. In this case, the NFC response forwaiting at T82, the NFC request at T132, and the NFC request at T142 areexamples of the “first wait information”, the “cancel request”, and the“second inquiry”, respectively. The rank “2” included in the NFCresponse for waiting at T82 and the rank “1” included in the NFCresponse at T144 are examples of the “first number information” and the“third number information”, respectively.

(Variation 1)

The upper limit that the printer PR is capable of establishing awireless connection does not have to be “2” and may be “1” or “3” ormore. The following variation 1-1 or 1-2 may be employed, for example.

(Variation 1-1)

For example, if the upper limit is “1”, the printer PR forms a firstWFDNW so as to establish a wireless connection with the terminal Ta andthen, in a case where a NFC request including a connection request isobtained from the terminal Tb, the printer PR determines that theconnection number has reached the upper limit. In this case, the printerPR supplies a NFC response for waiting to the terminal Tb. Then, in acase where the wireless connection with the terminal Ta is disconnected,the printer PR newly forms a second WFDNW different from the first WFDNWso as to establish a wireless connection with the terminal Tb. In thisvariation, the terminal Ta and the terminal Tb are examples of the“specific external apparatus” and the “first external apparatus”,respectively.

(Variation 1-2)

If the upper limit is “4”, for example, the printer PR may construct asituation where two WFDNWs in which the printer PR itself operates asthe G/O apparatus are present at the same time. Then, in each of the twoWFDNWs, the maximum number of child stations may be “2”. For example,assume a situation where the printer PR establishes a wirelessconnection with each of the two terminals Ta and Tb operating as childstations of a first WFDNW and establishes a wireless connection witheach of the two terminals Tc and Td operating as child stations of thesecond WFDNW. In such a situation, in a case where a NFC requestincluding a connection request is obtained from a specific terminal, notshown, the printer PR determines that the connection number has reachedthe upper limit. In this case, the printer PR supplies a NFC responsefor waiting to the specific terminal. Then, in a case where the wirelessconnection with the terminal Ta is disconnected and then, the wirelessconnection with the terminal Tb is disconnected, for example, theprinter PR causes the first WFDNW to disappear. Subsequently, theprinter PR newly forms a third WFDNW different from the first and secondWFDNWs so as to establish a wireless connection with the specificterminal. In this variation, the terminal Tb and the specific terminalare examples of the “specific external apparatus” and the “firstexternal apparatus”, respectively. In a wireless network in which acommunication apparatus operates as a parent station as in thisvariation, the maximum number of the child station may be “2” or more.

(Variation 2)

The printer PR may comprise a specific I/F for other types of wirelesscommunication such as Bluetooth (registered trademark), Transfer Jet(registered trademark), infrared rays and the like, instead ofcomprising the NFC I/F 18. Then, the printer PR may obtain a wirelessconnection request from a terminal via the above-described specific I/F.Moreover, the printer PR may obtain a wireless connection request(Association Request, for example) from a terminal via the wireless LANI/F 20, for example. That is, a communication apparatus may obtain awireless connection request from an external apparatus by using anytypes of I/F. Similarly, a communication apparatus may supply waitinformation to an external apparatus by using any types of I/F.

(Variation 3)

The CPU 32 may activate so-called SoftAP so as to operate the printer PRas a pseudo AP, instead of operating as a G/O apparatus of the WFDmethod. In this variation, also, the CPU 32 can form a wireless networkin which the printer PR operates as a parent station.

(Variation 4)

The “communication apparatus” is not limited to the printer PR and maybe other types of apparatus (a scanner, a facsimile machine, atelephone, a multi-function machine, a wireless access point, a PC, amobile terminal and the like, for example). Generally speaking, the“communication apparatus” may be any types of apparatuses as long as itoperates as a parent station of a wireless network and is an apparatuscapable of establishing a wireless connection with an externalapparatus.

(Variation 5)

In the above embodiment, the CPU 32 of the printer PR executes theprogram 36 (that is, software) in the memory 34 so that each process inFIGS. 2 to 4 is realized. Instead of that, at least one of the processesin FIGS. 2 to 4 may be realized by hardware such as a logical circuitand the like.

What is claimed is:
 1. A communication apparatus comprising: aprocessor; and a memory storing computer-readable instructions therein,the computer-readable instructions, when executed by the processor,causing the communication apparatus to: obtain a first wirelessconnection request from a first external apparatus; determine whether aconnection number has reached an upper limit in a case where the firstwireless connection request is obtained from the first externalapparatus, the connection number being a total number of a wirelessconnection which has been currently established by the communicationapparatus; supply first wait information to the first external apparatusin a case where the first wireless connection request is obtained fromthe first external apparatus and it is determined that the connectionnumber has reached the upper limit, the first wait information being forcausing the first external apparatus to wait until when a situation isrealized where the communication apparatus is capable of establishing awireless connection with the first external apparatus; and newly form asecond wireless network which is different from a first wireless networkto which both of the communication apparatus and a specific externalapparatus had belonged, so as to establish a wireless connection withthe first external apparatus, in a case where a wireless connectionbetween the communication apparatus and the specific external apparatusis disconnected after the first wait information is supplied to thefirst external apparatus, wherein in the first wireless network, thecommunication apparatus is configured to operate as a parent station andthe specific external apparatus is configured to operate as a childstation, and in the second wireless network, the communication apparatusis configured to operate as a parent station and the first externalapparatus is configured to operate as a child station.
 2. Thecommunication apparatus as in claim 1, wherein the computer-readableinstructions, when executed by the processor, further cause thecommunication apparatus to: supply instruction information to the firstexternal apparatus after the second wireless network in which thecommunication apparatus operates as the parent station is formed, so asto establish the wireless connection with the first external apparatus,the instruction information being for instructing the first externalapparatus to participate in the second wireless network as the childstation.
 3. The communication apparatus as in claim 2, wherein the firstwireless connection request includes a MAC address of the first externalapparatus, and the instruction information includes the MAC address ofthe first external apparatus.
 4. The communication apparatus as in claim1, further comprising: a first interface, wherein the connection numberis a total number of a wireless connection which has been currentlyestablished via the first interface by the communication apparatus, andthe wireless connection with the first external apparatus is establishedvia the first interface.
 5. The communication apparatus as in claim 1,further comprising: a second interface, wherein the first wirelessconnection request is obtained via the second interface, and the firstwait information is supplied via the second interface.
 6. Thecommunication apparatus as in claim 1, wherein the computer-readableinstructions, when executed by the processor, further cause thecommunication apparatus to: newly form a third wireless network so as toestablish a wireless connection with the first external apparatus, in acase where the first wireless connection request is obtained from thefirst external apparatus and it is determined that the connection numberhas not reached the upper limit, wherein in the third wireless network,the communication apparatus is configured to operate as a parent stationand the first external apparatus is configured to operate as a childstation.
 7. The communication apparatus as in claim 6, wherein the firstwireless connection request is obtained in a state where the firstwireless network to which both of the communication apparatus and thespecific external apparatus belongs is being formed, and the thirdwireless network is newly formed while maintaining the state where thefirst wireless network is being formed, in the case where the firstwireless connection request is obtained front the first externalapparatus and it is determined that the connection number has notreached the upper limit.
 8. The communication apparatus as in claim 1,wherein the computer-readable instructions, when executed by theprocessor, further cause the communication apparatus to: obtain a secondwireless connection request from a second external apparatus after thefirst wait information is supplied to the first external apparatus andbefore the wireless connection between the communication apparatus andthe specific external apparatus is disconnected; determine that theconnection number has reached the upper limit in a case where the secondwireless connection request is obtained from the second externalapparatus; and supply second wait information to the second externalapparatus in a case where the second wireless connection request isobtained from the second external apparatus and it is determined thatthe connection number has reached the upper limit, the second waitinformation being for causing the second external apparatus to waituntil when a situation is realized where the communication apparatus iscapable of establishing a wireless connection with the second externalapparatus, wherein in a case where the first wait information issupplied to the first external apparatus, then the second waitinformation is supplied to the second external apparatus, and then thewireless connection between the communication apparatus and the specificexternal apparatus is disconnected, the wireless connection with thefirst external apparatus, that has supplied the wireless connectionrequest to the communication apparatus earlier than the second externalapparatus, is established on a priority basis.
 9. The communicationapparatus as in claim 1, wherein the first wait information includesfirst number information related to a current total number of a waitapparatus which is waiting until when a situation is realized where thecommunication apparatus is capable of establishing a wireless connectionwith the wait apparatus.
 10. The communication apparatus as in claim 9,wherein the computer-readable instructions, when executed by theprocessor, further cause the communication apparatus to: obtain a firstinquiry related to a total number of the wait apparatus from the firstexternal apparatus, after the first wait information including the firstnumber information is supplied to the first external apparatus and thena wireless connection with at least one wait apparatus is established;and supply second number information related to a current total numberof the wait apparatus to the first external apparatus in a case wherethe first inquiry is obtained from the first external apparatus, thesecond number information indicating that the current total number ofthe wait apparatus is less than the first number information.
 11. Thecommunication apparatus as in claim 9, wherein the computer-readableinstructions, when executed by the processor, further cause thecommunication apparatus to: obtain a second inquiry related to a totalnumber of the wait apparatus from the first external apparatus, afterthe first wait information including the first number information issupplied to the first external apparatus and then a cancel request isobtained from at least one wait apparatus, the cancel request being forcancelling a plan of an establishment of a wireless connection betweenthe communication apparatus and the wait apparatus; and supply thirdnumber information related to a current total number of the waitapparatus to the first external apparatus in a case where the secondinquiry is obtained from the first external apparatus, the third numberinformation indicating that the current total number of the waitapparatus is less than the first number information.
 12. Thecommunication apparatus as in claim 1, wherein a network identifier ofthe first wireless network is different from a network identifier of thesecond wireless network.
 13. A non-transitory computer-readable mediumstoring computer-readable instructions for a communication apparatus,wherein the computer-readable instructions, when executed by a processormounted on the communication apparatus, cause the communicationapparatus to: obtain a first wireless connection request from a firstexternal apparatus; determine whether a connection number has reached anupper limit in a case where the first wireless connection request isobtained from the first external apparatus, the connection number beinga total number of a wireless connection which has been currentlyestablished by the communication apparatus; supply first waitinformation to the first external apparatus in a case where the firstwireless connection request is obtained from the first externalapparatus and it is determined that the connection number has reachedthe upper limit, the first wait information being for causing the firstexternal apparatus to wait until when a situation is realized where thecommunication apparatus is capable of establishing a wireless connectionwith the first external apparatus; and newly faun a second wirelessnetwork which is different from a first wireless network to which bothof the communication apparatus and a specific external apparatus hadbelonged, so as to establish a wireless connection with the firstexternal apparatus, in a case where a wireless connection between thecommunication apparatus and the specific external apparatus isdisconnected after the first wait information is supplied to the firstexternal apparatus, wherein in the first wireless network, thecommunication apparatus is configured to operate as a parent station andthe specific external apparatus is configured to operate as a childstation, and in the second wireless network, the communication apparatusis configured to operate as a parent station and the first externalapparatus is configured to operate as a child station.
 14. Thenon-transitory computer-readable medium as in claim 13, wherein thecomputer-readable instructions, when executed by the processor, furthercause the communication apparatus to: supply instruction information tothe first external apparatus after the second wireless network in whichthe communication apparatus operates as the parent station is formed, soas to establish the wireless connection with the first externalapparatus, the instruction information being for instructing the firstexternal apparatus to participate in the second wireless network as thechild station.
 15. The non-transitory computer-readable medium as inclaim 14, wherein the first wireless connection request includes a MACaddress of the first external apparatus, and the instruction informationincludes the MAC address of the first external apparatus.
 16. Thenon-transitory computer-readable medium as in claim 13, wherein theconnection number is a total number of a wireless connection which hasbeen currently established via a first interface of the communicationapparatus by the communication apparatus, and the wireless connectionwith the first external apparatus is established via the firstinterface.
 17. The non-transitory computer-readable medium as in claim13, wherein the first wireless connection request is obtained via asecond interface of the communication apparatus, and the first waitinformation is supplied via the second interface.
 18. The non-transitorycomputer-readable medium as in claim 13, wherein the computer-readableinstructions, when executed by the processor, further cause thecommunication apparatus to: newly form a third wireless network so as toestablish a wireless connection with the first external apparatus, in acase where the first wireless connection request is obtained from thefirst external apparatus and it is determined that the connection numberhas not reached the upper limit, wherein in the third wireless network,the communication apparatus is configured to operate as a parent stationand the first external apparatus is configured to operate as a childstation.
 19. The non-transitory computer-readable medium as in claim 18,wherein the first wireless connection request is obtained in a statewhere the first wireless network to which both of the communicationapparatus and the specific external apparatus belongs is being formed,and the third wireless network is newly formed while maintaining thestate where the first wireless network is being formed, in the casewhere the first wireless connection request is obtained from the firstexternal apparatus and it is determined that the connection number hasnot reached the upper limit.
 20. The non-transitory computer-readablemedium as in claim 13, wherein the computer-readable instructions, whenexecuted by the processor, further cause the communication apparatus to:obtain a second wireless connection request from a second externalapparatus after the first wait information is supplied to the firstexternal apparatus and before the wireless connection between thecommunication apparatus and the specific external apparatus isdisconnected; determine that the connection number has reached the upperlimit in a case where the second wireless connection request is obtainedfrom the second external apparatus; and supply second wait informationto the second external apparatus in a case where the second wirelessconnection request is obtained from the second external apparatus and itis determined that the connection number has reached the upper limit,the second wait information being for causing the second externalapparatus to wait until when a situation is realized where thecommunication apparatus is capable of establishing a wireless connectionwith the second external apparatus, wherein in a case where the firstwait information is supplied to the first external apparatus, then thesecond wait information is supplied to the second external apparatus,and then the wireless connection between the communication apparatus andthe specific external apparatus is disconnected, the wireless connectionwith the first external apparatus, that has supplied the wirelessconnection request to the communication apparatus earlier than thesecond external apparatus, is established on a priority basis.
 21. Thenon-transitory computer-readable medium as in claim 13, wherein thefirst wait information includes first number information related to acurrent total number of a wait apparatus which is waiting until when asituation is realized where the communication apparatus is capable ofestablishing a wireless connection with the wait apparatus.
 22. Thenon-transitory computer-readable medium as in claim 21, wherein thecomputer-readable instructions, when executed by the processor, furthercause the communication apparatus to: obtain a first inquiry related toa total number of the wait apparatus from the first external apparatus,after the first wait information including the first number informationis supplied to the first external apparatus and then a wirelessconnection with at least one wait apparatus is established; and supplysecond number information related to a current total number of the waitapparatus to the first external apparatus in a case where the firstinquiry is obtained, from the first external apparatus, the secondnumber information indicating that the current total number of the waitapparatus is less than the first number information.
 23. Thenon-transitory computer-readable medium as in claim 21, wherein thecomputer-readable instructions, when executed by the processor, furthercause the communication apparatus to: obtain a second inquiry related toa total number of the wait apparatus from the first external apparatus,after the first wait information including the first number informationis supplied to the first external apparatus and then a cancel request isobtained from at least one wait apparatus, the cancel request being forcancelling a plan of an establishment of a wireless connection betweenthe communication apparatus and the wait apparatus; and supply thirdnumber information related to a current total number of the waitapparatus to the first external apparatus in a case where the secondinquiry is obtained from the first external apparatus, the third numberinformation indicating that the current total number of the waitapparatus is less than the first number information.
 24. Thenon-transitory computer-readable medium as in claim 13, wherein anetwork identifier of the first wireless network is different from anetwork identifier of the second wireless network.
 25. A methodperformed by a communication apparatus, the method comprising: obtaininga first wireless connection request from a first external apparatus;determining whether a connection number has reached an upper limit in acase where the first wireless connection request is obtained from thefirst external apparatus, the connection number being a total number ofa wireless connection which has been currently established by thecommunication apparatus; supplying first wait information to the firstexternal apparatus in a case where the first wireless connection requestis obtained from the first external apparatus and it is determined thatthe connection number has reached the upper limit, the first waitinformation being for causing the first external apparatus to wait untilwhen a situation is realized where the communication apparatus iscapable of establishing a wireless connection with the first externalapparatus; and newly forming a second wireless network which isdifferent from a first wireless network to which both of thecommunication apparatus and a specific external apparatus had belonged,so as to establish a wireless connection with the first externalapparatus, in a case where a wireless connection between thecommunication apparatus and the specific external apparatus isdisconnected after the first wait information is supplied to the firstexternal apparatus, wherein in the first wireless network, thecommunication apparatus is configured to operate as a parent station andthe specific external apparatus is configured to operate as a childstation, and in the second wireless network, the communication apparatusis configured to operate as a parent station and the first externalapparatus is configured to operate as a child station.